package com.youxuan.ssyx.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum ActivityType {
    FULL_REDUCTION(1,"满减"),
    FULL_DISCOUNT(2,"满量打折" );

    @EnumValue
    private Integer code ;
    private String comment ;

    ActivityType(Integer code, String comment ){
        this.code=code;
        this.comment=comment;
    }

    public static String getCommentByCode(Integer code) {
        for (ActivityType activityType : values()) {
            if (activityType.getCode().equals(code)) {
                return activityType.getComment();
            }
        }
        return null; // 如果没有找到匹配的code，可以返回null或者一个默认值
    }
}